package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.admin.entity.DictItemDO;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.ZtcConfigAddDTO;
import org.jsola.hr.dto.ZtcConfigUpdateDTO;
import org.jsola.hr.dto.syncSocDTO.QdAttritionCheckDTO;
import org.jsola.hr.dto.syncSocDTO.QdEmploymentRegistrationUnit;
import org.jsola.hr.dto.syncSocDTO.QdIncrementCheckDTO;
import org.jsola.hr.dto.syncSocDTO.ZtcAccessTokenDTO;
import org.jsola.hr.query.ZtcConfigQuery;
import org.jsola.hr.vo.ZtcConfigListVO;
import org.jsola.hr.vo.ZtcConfigVO;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 政企直通车配置
 *
 * @author zhr
 */
@Api(tags = "hr-政企直通车配置")
public interface IZtcConfigControllerAPI {

    /**
     * 新增政企直通车配置
     *
     * @param ztcConfigAddDTO 政企直通车配置新增实体
     * @return 政企直通车配置展示对象
     */
    @ApiOperation(value = "新增政企直通车配置")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ztcConfigAddDTO", dataType = "ZtcConfigAddDTO", value = "新增政企直通车配置", paramType = "body")
    })
    Result<ZtcConfigVO> save(ZtcConfigAddDTO ztcConfigAddDTO);


    /**
     * 修改政企直通车配置
     *
     * @param ztcConfigUpdateDTO 政企直通车配置
     * @return 更新数量
     */
    @ApiOperation(value = "修改政企直通车配置")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ztcConfigUpdateDTO", dataType = "ZtcConfigUpdateDTO", value = "修改政企直通车配置", paramType = "body")
    })
    Result<Integer> update(ZtcConfigUpdateDTO ztcConfigUpdateDTO);


    /**
     * 删除单个政企直通车配置，彻底删除
     *
     * @param ztcConfigId 政企直通车配置id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个政企直通车配置，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ztcConfigId", dataType = "String", value = "政企直通车配置id", paramType = "path")
    })
    Result<Integer> delete(String ztcConfigId);


    /**
     * 批量删除政企直通车配置，彻底删除
     *
     * @param ztcConfigIds 政企直通车配置id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除政企直通车配置，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ztcConfigIds", dataType = "String[]", value = "政企直通车配置id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] ztcConfigIds);


    /**
     * 根据政企直通车配置id查询政企直通车配置详情
     *
     * @param ztcConfigId 政企直通车配置id
     * @return 政企直通车配置详情
     */
    @ApiOperation(value = "根据政企直通车配置id查询政企直通车配置详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ztcConfigId", dataType = "String", value = "政企直通车配置id", paramType = "path")
    })
    Result<ZtcConfigVO> findById(String ztcConfigId);


    /**
     * 查询政企直通车配置
     *
     * @param ztcConfigQuery 政企直通车配置查询参数
     * @return page
     */
    @ApiOperation(value = "查询政企直通车配置")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ztcConfigQuery", dataType = "ZtcConfigQuery", value = "政企直通车配置查询参数", paramType = "query")
    })
    Result<List<ZtcConfigListVO>> listAll(ZtcConfigQuery ztcConfigQuery);


    /**
     * 分页查询政企直通车配置
     *
     * @param ztcConfigQuery 政企直通车配置查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询政企直通车配置")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ztcConfigQuery", dataType = "ZtcConfigQuery", value = "政企直通车配置查询参数", paramType = "query")
    })
    Result<Page<ZtcConfigListVO>> page(ZtcConfigQuery ztcConfigQuery);

    /**
     * 分页查询直通车配置
     *
     * @param ztcConfigQuery 查询参数
     * @return 配置信息
     */
    @ApiOperation(value = "分页查询直通车配置")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ztcConfigQuery", dataType = "ZtcConfigQuery", value = "政企直通车配置查询参数", paramType = "query")
    })
    Result<Page<ZtcConfigListVO>> selectPageConfig(ZtcConfigQuery ztcConfigQuery);

    /**
     * 查询用工单位需不需要输入直通车密码
     *
     * @param companyId 公司Id
     * @return bool
     */
    @ApiOperation(value = "查询用工单位需不需要输入直通车密码")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司Id", paramType = "path")
    })
    Result<Boolean> ztcAccessTokenExist(String companyId);

    /**
     * 根据账号获取AccessToken 并存入缓存
     *
     * @param ztcAccessTokenDTO 保存参数
     * @return bool
     */
    @ApiOperation(value = "根据账号获取AccessToken 并存入缓存")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ztcAccessTokenDTO", dataType = "ZtcAccessTokenDTO", value = "保存参数", paramType = "body")
    })
    Result<String> saveCacheAccessToken(ZtcAccessTokenDTO ztcAccessTokenDTO);

    /**
     * 校验一下增员的这批人
     *
     * @param ztcAccessTokenDTO 增员参数
     * @return 校验结果
     */
    @ApiOperation(value = "校验一下增员的这批人")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ztcAccessTokenDTO", dataType = "ZtcAccessTokenDTO", value = "增员参数", paramType = "body")
    })
    Result<List<QdIncrementCheckDTO>> checkEmpQdWebSite(ZtcAccessTokenDTO ztcAccessTokenDTO);

    /**
     * 校验一下减员的这批人
     *
     * @param ztcAccessTokenDTO 减员参数
     * @return 校验结果
     */
    @ApiOperation(value = "校验一下减员的这批人")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ztcAccessTokenDTO", dataType = "ZtcAccessTokenDTO", value = "增员参数", paramType = "body")
    })
    Result<List<QdAttritionCheckDTO>> checkDecreaseEmpQdWebSite(ZtcAccessTokenDTO ztcAccessTokenDTO);

    /**
     * 获取就业单位列表
     *
     * @param areaId 地区Id
     * @return 就业单位列表
     */
    @ApiOperation(value = "获取就业单位列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "areaId", dataType = "String", value = "地区Id", paramType = "path")
    })
    Result<List<QdEmploymentRegistrationUnit>> getEmploymentRegistrationUnit(String areaId);

    /**
     * 查询某一项字典项的所有子项
     *
     * @param dictCode code
     * @return 子项列表
     */
    @ApiOperation(value = "查询某一项字典项的所有子项")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dictCode", dataType = "String", value = "dictCode", paramType = "query")
    })
    Result<List<DictItemDO>> selectByDictCode(String dictCode);

    /**
     * 根据parentId查询子集
     *
     * @param dictCode code
     * @param parentId 父级Id
     * @return 子项
     */
    @ApiOperation(value = "根据parentId查询子集")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dictCode", dataType = "String", value = "dictCode", paramType = "query"),
            @ApiImplicitParam(name = "parentId", dataType = "String", value = "parentId", paramType = "query")
    })
    Result<List<DictItemDO>> selectDictByParentId(String dictCode, String parentId);

    /**
     * 根据字典项code和传入的关键字模糊搜索字典项下的子项
     *
     * @param value    关键字
     * @param dictCode 字典项code
     * @return 搜索结果
     */
    @ApiOperation(value = "根据字典项code和传入的关键字模糊搜索字典项下的子项")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "value", dataType = "String", value = "dictCode", paramType = "query"),
            @ApiImplicitParam(name = "dictCode", dataType = "String", value = "parentId", paramType = "query")
    })
    Result<List<DictItemDO>> selectLikeByCodeAndName(String value, String dictCode);

    /**
     * 获取当前登录用户的cookie
     *
     * @param areaId 地区Id
     * @return cookie
     */
    @ApiOperation(value = "获取当前登录用户的cookie")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "areaId", dataType = "String", value = "地区Id", paramType = "path")
    })
    Result<String> getWebSiteCookie(String areaId);
}

